/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package usuario;

/**
 *
 * @author Deico
 */

import conexion.DB;
import java.util.Date;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.JOptionPane;

public class autoridad {
    
    public static boolean isExist(String user){


        boolean flag = false;
        try {

          java.sql.Statement stat = DB.DB_CONNECTION.createStatement();
          ResultSet rs = stat.executeQuery("select rut from autoridad where rut='"+user+"';");
          
          while (rs.next()) {
        
          flag=true;
          }
          rs.close();
          
          return flag;

         } catch (SQLException ex) { 
         JOptionPane.showMessageDialog(null, ex, "Error", JOptionPane.ERROR_MESSAGE);
         }
         return flag;
    }
}
